package com.devops.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.devops.admin.mapper.DOSEnvTypeMapper;
import com.devops.admin.model.DOSEnvType;
import com.devops.admin.service.DOSEnvTypeService;
import com.devops.constant.DOSEnvTypeEnum;
import org.springframework.stereotype.Service;

/**
 * @ClassName DOSEnvTypeServiceImpl
 * @Description TODO
 * @Author hepingguo
 * @Date 2022/6/17 09:31
 * @Version 1.0
 **/
@Service
public class DOSEnvTypeServiceImpl extends ServiceImpl<DOSEnvTypeMapper, DOSEnvType> implements DOSEnvTypeService {
    /**
     * 校验envType合法性 从枚举类中取
     * @param envType
     * @return
     */
    @Override
    public Boolean validEnvType(Integer envType) {
        if (envType != null) {
            return envType.intValue() == DOSEnvTypeEnum.UAT.getType() || envType.intValue() == DOSEnvTypeEnum.PRO.getType();
        } else {
            return false;
        }

    }
}
